﻿#region
/*******************************************************************************
** File Name:		    SupplierRepository.cs
** Creator:		        chao.jiang 
** EMail:               chao.jiang 
** Create date:	        
** Latest Modifier:
** Latest Modify date:
** Description:		    
** Modify History:
**
** Code Review:
**
** Version number:       1.0.0
*********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using EWineShop.Entity;
using EWineShop.Respository;
using IBatisNet.DataMapper;
using EWineShop.Data.IBatis;

namespace EWineShop.IBatisRepository
{
    public class SupplierRepository : BaseIBatisDao,ISupplier
    {
    
		#region  Auto Generation

        public SupplierRepository()
            : base("/Config/IBatis/EWineShopMap.Config")
        {

        }
        		
        public void AddSupplier(ESupplier entity)
        {
			string stmtId = "SupplierMap.InsertSupplier";
			base.SqlMapper.Insert(stmtId, entity);
        }
        
		public  ESupplier GetByID (System.Int64 iD)
        {
			string stmtId = "SupplierMap.SelectByID";
			return base.SqlMapper.QueryForObject<ESupplier>(stmtId, iD);
        }
        
        public  void DeleteByID (System.Int64 iD)
        {
			string stmtId = "SupplierMap.DeleteByID";
			base.SqlMapper.Update(stmtId, iD);
        }
        
        public  void UpdateByID (ESupplier entity)
        {
			string stmtId = "SupplierMap.UpdateByID";
			base.SqlMapper.Update(stmtId, entity);
        }


		#endregion
    }
}

